<template>
  <div class="issue">
    <!-- <el-row :style="{paddingBottom: 0}">
      <el-col>
        <dynForm :info-form="searchForm" :search-tags="searchTags">
          <el-button
            type="primary"
            icon="el-icon-search"
            @click="doSearch">
            {{ $t("search") }}
          </el-button>
        </dynForm>
      </el-col>
    </el-row> -->
    <!-- 表格主体部分 -->
    <el-row>
      <dynTable
        ref="dynTable"
        :loading="tableLoading"
        :table-data="tableData"
        :table-columns="tableColumns"
        :handle-selection-change="handleSelectionChange"
        :row-click="rowClick"
      />
      <!--分页组件-->
      <pagination
        :total="total"
        :page.sync="listQuery.page"
        :limit.sync="listQuery.size"
        @pagination="getList"
      />
    </el-row>
    <!-- 弹窗组件 -->
    <issue-dialog ref="issueDialog" />
  </div>
</template>
<script>
import IssueDialog from './components/issueDialog'
import mySetting from '@/mixins/mySetting'
export default {
  name: 'IssueSystem',
  components: {
    IssueDialog
  },
  mixins: [mySetting],
  data() {
    return {
      searchForm: {},
      searchTags: [
        { label: this.$t('eqpType'), prop: 'lotId', tag: 'DynSelect' }
      ],
      tableLoading: true,
      tableColumns: [
        {
          prop: 'label',
          label: 'LSR Number',
          width: '120px'
        },
        {
          prop: 'layoutname',
          label: '设备名'
        },
        {
          prop: 'prop',
          label: '最初停机/使用开始时间',
          width: '170px'
        },
        {
          prop: 'regionname',
          label: '申请人'
        },
        {
          prop: 'type',
          label: '问题描述'
        },
        {
          prop: 'type',
          label: '处理人'
        },
        {
          prop: 'type',
          label: '措施/内容'
        },
        {
          prop: 'type',
          label: '最新处理时间',
          width: '140px'
        },
        {
          prop: 'type',
          label: '总处理时间(Mins)',
          width: '170px'
        }
      ]
    }
  },
  created() {
    this.getMock()
  },
  methods: {
    scopedHandle(val) {
      console.log('接收到子组件的值', val)
      this.$refs.issueDialog.handleOpen()
    },
    // 模拟数据
    getMock() {
      // const data = Mock.mock({
      //   'items|5': [
      //     {
      //       id: '@id',
      //       label: '@sentence(1,3)',
      //       prop: '@sentence(5,10)',
      //       layoutname: '@sentence(5,20)',
      //       regionname: '@sentence(10,20)',
      //       'type|1': ['生产布局', '生产布局2'],
      //       'status|1': ['true', 'false']
      //     }
      //   ]
      // })
      // this.tableData = data.items
      this.tableLoading = false
    },
    // 切换分页
    getList(val) {
      console.log(val)
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/defaultStyle.scss";
.el-form-item {
  margin: 0 10px 15px 0;
}
</style>
